﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using CTMOES;
using CTMOES.Helper;
using CTMOES.Models;

namespace CTMOES.Controllers
{
    public class ManagerController : Controller
    {

        private readonly CTMDBEntities _db = new CTMDBEntities();
        //
        // GET: /Manager/

        public ActionResult Index()
        {
            if(Membership.GetUser()!=null)
            {
                return View();                
            }
            else
            {
                return RedirectToAction("LogOn", "Account");
            }

        }

        //
        // GET: /Choice/

        public PartialViewResult Choice()
        {
            //List<QueModel> QueList = DataHelper.GetQueList(0);
            List<QueModel> QueList = new List<QueModel>();
            QueList = DataHelper.GetQueList(0);
            return PartialView(QueList);
        }

        public PartialViewResult CreateChoice()
        {
            ViewData["Subject"] = _db.Subject.ToList();
            QueModel Que = new QueModel();
            Que.OptionList = new List<OptionModel>();
            return PartialView(Que);
            
        }

        public ActionResult MultiChoice()
        {
            return View();
        }
    }
}
